Skip to content

Fix TPostScript color setting#21777

Closed
couet wants to merge 5 commits intomasterfrom
ps-fix
Closed

Fix TPostScript color setting#21777
couet wants to merge 5 commits intomasterfrom
ps-fix

Conversation

@couet
Copy link
Copy Markdown
Member

@couet couet commented Apr 2, 2026

In TPostScript (like in TPDF) the color should be set in the file only when something painted.

The previous version of TPostScript set the color to many times and the following macro produced a very large file:

void large_ps()
{
    auto c1 = new TCanvas("c1","c1",500,500);
    auto box = new TBox(0.1,0.1,0.9,0.9);
    box->SetFillColor(kYellow);
    box->SetFillStyle(1001);
    c1->Add(box);

    TPostScript ps1("large.ps");

    for (int n = 0; n < 1000000; ++n) {
       gVirtualPS->SetFillColor(kRed);
       gVirtualPS->SetLineColor(kGreen);
    }
    c1->Draw();
    ps1.Close();
}

@couet couet requested a review from linev April 2, 2026 13:57
@couet couet self-assigned this Apr 2, 2026
@linev
Copy link
Copy Markdown
Member

linev commented Apr 2, 2026

There are few more attributes which should be checked.

These are line width and style.

@linev
Copy link
Copy Markdown
Member

linev commented Apr 2, 2026

And also that about text color

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Test Results

    20 files      20 suites   2d 18h 23m 59s ⏱️
 3 809 tests  3 805 ✅  1 💤  3 ❌
68 663 runs  68 618 ✅ 18 💤 27 ❌

For more details on these failures, see this check.

Results for commit d8a6635.

♻️ This comment has been updated with latest results.

@couet couet requested a review from dpiparo as a code owner April 7, 2026 10:42
@couet couet closed this Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants